﻿using Microsoft.AspNetCore.Mvc;

namespace RESTfulDemo.Controllers {

    [Route("api/rtntype")]
    public class ReturnTypeDemo : ControllerBase {

        [HttpGet("age")]
        public int GetAge() {
            return 18;
        }

        [HttpGet("name")]
        public string GetName() {
            return "UnitySir";
        }

        [HttpGet("names")]
        public IEnumerable<string> GetNames() {
            return new string[] {
                "UnitySir1","UnitySir2","UnitySir3"
            };
        }

        [HttpGet("namesdic")]
        public IDictionary<string, string> GetNamesDic() {
            return new Dictionary<string, string> {
                {"001","UnitySir1" },
                {"002","UnitySir1" },
                {"003","UnitySir1" },
            };
        }


        [HttpGet("myname")]
        public ActionResult<string> MyName() {
            return "UnitySir";
        }

    }
}
